#include<stdio.h>

void turn(void *p,int type);

int main()
{
	char ch = 'f',ch1 = 'R',ch2 = -100;
	short s_num = -11;
	int num = 100;
	double d_num = 3.5;
	
	turn(&ch,1);
	turn(&ch1,1);
	turn(&ch2,1);
	turn(&s_num,4);
	turn(&num,2);
	turn(&d_num,3);
	
	printf("%c %c %hhd %hd %d %lg",ch,ch1,ch2,s_num,num,d_num); 
	
	
	return 0;
}

//type :1---char   2---int   3---double   4---short 
void turn(void *p,int type)
{
	
	if(type == 1){
		char ch = *(char *)p;
		if(ch >='A' && ch <= 'Z'){
			*(char *)p = ch + 32;
		}
		else if(ch >= 'a' && ch <= 'z'){
			*(char *)p = ch - 32; 
		}
		else{
			*(char *)p = - ch;
		}
	}
	else if(type == 2)
		*(int *)p = -*(int *)p;
	else if(type == 3)
		*(double *)p = -*(double *)p;
	else if(type == 4)
		*(short *)p = -*(short *)p;
	
}
